package com.css.common.core.utils;


import cn.hutool.core.util.StrUtil;
import com.css.common.core.enums.FxPayTypeEnum;

import java.util.StringJoiner;

/**
 * @description: 订单工具类
 * @Title: OrderUtil
 * @Author xlw
 * @Package com.invoice.tcc.util
 * @Date 2024/12/9 11:48
 */
public class OrderUtil {

    /**
     * 构建订单备注
     *
     * @param ddid        DDID
     * @param payTypeEnum pay 类型枚举
     * @param bz          bz
     * @return {@link String }
     */
    public static String bulidOrderBz(String ddid, FxPayTypeEnum payTypeEnum, String bz) {
        StringJoiner result = new StringJoiner("  ");
        //result.add("乐企模式：联用支付即开票");
        result.add("支付渠道：" + payTypeEnum.getDesc());
        result.add("交易单号：" + ddid);
        result.add("\r\n");
        result.add(StrUtil.isNotBlank(bz) ? bz : "");
        return result.toString();
    }

    public static String bulidFxOrderBz(String bz) {
        StringJoiner result = new StringJoiner("  ");
        result.add("乐企模式：联用支付即开票");
        result.add("\r\n");
        result.add(StrUtil.isNotBlank(bz) ? bz : "");
        return result.toString();
    }
}
